/**
 * @program: yygh_parent
 * @ClassName ExcelListener
 * @description:
 * @author: zyw
 * @create: 2023-05-20 21:17
 * @Version 1.0
 **/
package com.atguigu.yygh.cmn.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ExcelListener extends AnalysisEventListener<Stu> {


    //创建list集合封装最终的数据
    List<Stu> list = new ArrayList<>();
    @Override
    public void invoke(Stu stu, AnalysisContext analysisContext) {
        System.out.println("list = " + list);
        list.add(stu);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        //表头信息
        System.out.println("headMap = " + headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        //将未添加如的数据添加
    }
}
 
